!
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var book = { _value: 2019, edit: 2 }
        Object.defineProperty(book, 'value', {
            get() {
                return this._value              //返回什么，，value就是什么 不返回，value就是undefined
            },
            set(n) {
                this.edit = n             // 给谁赋值，就直接改变谁。。
                this._value = 0

            }
        })
        book.value = 2020
        console.log(book)
        console.log(book.value)
    </script>
</body>

</html>